<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>

<html>
<head>
    <title>我的任务</title>
    <meta name="menu" content="assigneeTasks"/>

    <script type="text/javascript">
          $(document).ready(function(){
              $("#processDefinitionName, #dueDateFlag").change(function(){
                    searchPage();
              });

              $("#excelExport").click(function(){
                  var mainForm = $("#mainForm");
                  mainForm.attr("action","task!inboxExp.action");
                  mainForm.submit();
                  mainForm.attr("action","task!inbox.action");
              })

          })
    </script>

</head>

<body>
<div class="content_block">
    <%@ include file="/common/messages.jsp" %>
    <h2 class="jquery_tab_title">我的任务</h2>
    <form action="task!inbox.action" method="post" id="mainForm">
        <input type="hidden" id="fileDownloadToken" name="fileDownloadToken">
        <div>
            <p>
                <label class="inline">流程名:</label>
                <code:dispCodeList id="processDefinitionName" name="filter.processDefinitionName" table="ACT_RE_PROCDEF" codeColumn="NAME_"  valueColumn="NAME_"
                                   codeValue="${filter.processDefinitionName}" displayHeader="true"/>
                <label class="inline">创建人:</label>
                <input name="filter.initiatorNameLike" type="text" value="${filter.initiatorNameLike}"
                       class="input-small" />
                <label class="inline">创建时间 从:</label>
                <input class="input-small flexy_datepicker_input" type="text" name="filter.startTimeFrom"
                       value="<s:date name='filter.startTimeFrom' format='yyyy-MM-dd'/>">
                <label class="inline">到:</label>
                <input class="input-small flexy_datepicker_input" type="text" name="filter.startTimeTo"
                       value="<s:date name='filter.startTimeTo' format='yyyy-MM-dd'/>">
                是否过期：
                <code:dispCodeList id="dueDateFlag" name="filter.dueDateFlag" codeType="DUE_DATE_FLAG"  displayHeader="true" codeValue="${filter.dueDateFlag}" />
                <a href="#" class="button" onclick="searchPage()">查询</a>
            </p>
            <table width="100%" cellpadding="0" id="table_liquid" cellspacing="0" summary="Employee Pay Sheet">
                <thead>
                <tr>
                    <th><a href="javascript:sort('D.NAME_','asc')" scope="col">流程名</a></th>
                    <th><a href="javascript:sort('subjectVariable.TEXT_','asc')" scope="col">任务名</a></th>
                    <th><a href="javascript:sort('assigneeUser.first_','asc')" scope="col">当前处理人</a></th>
                    <th><a href="javascript:sort('initiatorUser.first_','asc')" scope="col">创建人</a></th>
                    <th><a href="javascript:sort('T.create_time_','asc')" scope="col">创建时间</a></th>
                    <th><a href="javascript:sort('T.due_date_','asc')" scope="col">过期时间</a></th>
                    <th><a href="javascript:sort('T.NAME_','asc')" scope="col">当前状态</a></th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <s:iterator value="page.result">
                    <tr <c:if test="${overDue}"> class="warn"</c:if> >
                        <td>${processDefinitionName}&nbsp;</td>
                        <td><stringDisplay:short length="10" fullText="${subject}"/>&nbsp;</td>
                        <td>${assigneeName}&nbsp;</td>
                        <td>${initiatorName}&nbsp;</td>
                        <td><fmt:formatDate value="${createTime}" pattern="yyyy/MM/dd"/>&nbsp;</td>
                        <td><fmt:formatDate value="${dueDate}" pattern="yyyy/MM/dd"/>&nbsp;</td>
                        <td>${name}&nbsp;</td>
                        <td>
                            <a href='<s:url value="%{getFormKey(id)}"/>?taskId=${id}&currentMenu=assigneeTasks'>处理</a>&nbsp;
                        </td>
                    </tr>
                </s:iterator>
                <tr>
                    <td colspan="2" class="tdButton">
                    <c:if test="${page.totalCount>0}">
                    <a href="#"  id="excelExport" class="button">导出Excel</a>
                     </c:if>
                    </td>
                    <td colspan="9" class="pagination">
                        <%@ include file="/common/pagination.jsp" %>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </form>
</div>
<!--end content_block-->

</body>
</html>
